API Documentation
Public Member Functions | List of all members
nkWinUi::ComponentManager Class Referencefinal

Manages the components within nkWinUi. More...

Inheritance diagram for nkWinUi::ComponentManager:

Public Member Functions

ComponentcreateOrRetrieve (const std::string_view &name, COMPONENT_TYPE componentType)
 
Componentget (const std::string_view &name) const
 
void erase (const std::string_view &name)
 

Detailed Description

Manages the components within nkWinUi.

Responsible for creating and book-keeping them. At all time, the manager is responsible for the memory allocated inside it.

Member Function Documentation

◆ createOrRetrieve()

Component* nkWinUi::ComponentManager::createOrRetrieve ( const std::string_view &  name,
COMPONENT_TYPE  componentType 
)

Creates (if unavailable) or retrieves (if available) component attached to passed name.

Parameters
nameThe name, aka identifier, of the component to create or retrieve.
componentTypeThe type the component should be.
Returns
The component attached to passed name. The Manager is the owner of the memory returned.

◆ get()

Component* nkWinUi::ComponentManager::get ( const std::string_view &  name) const

Returns a component attached to a name, if available.

Parameters
nameThe name of the component that should be retrieved.
Returns
The component if existing, nullptr else.

◆ erase()

void nkWinUi::ComponentManager::erase ( const std::string_view &  name)

Erases a component. Memory attached to it will be freed.

Parameters
nameThe name identifying the component to erase.

The documentation for this class was generated from the following file: